home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / lang / SmallEiffel.lha / SmallEiffel / bin_c / pretty7.c < prev    next >
C/C++ Source or Header  |  1998-12-22  |  18KB  |  931 lines

  1. /*
  2. -- ANSI C code generated by :
  3. -- SmallEiffel The GNU Eiffel Compiler -- Release (- 0.79)      --
  4. -- Copyright (C), 1994-98 - LORIA - UHP - CRIN - INRIA - FRANCE --
  5. -- Dominique COLNET and Suzanne COLLIN -    colnet@loria.fr     --
  6. --                 http://www.loria.fr/SmallEiffel              --
  7. */
  8. #include "pretty.h"
  9. /*No:FIXED_ARRAY[TYPE_REF_TO_EXP].clear_all*/
  10. /*No:FIXED_ARRAY[TYPE_REF_TO_EXP].set_all_with*/
  11. /*No:FIXED_ARRAY[TYPE_REF_TO_EXP].count*/
  12.  
  13.  
  14. void r362resize(T362* C,T2 a1){
  15. T0* _elt_default=NULL;
  16. T2 _i=0;
  17. T2 _new_capacity=0;
  18. /*[IF*/
  19. if((a1)<=(/*(IRF4.6count*/((C)->_upper/*12*/)+(1)/*)*/)){
  20. C->_upper=(a1)-(1);
  21. }
  22. else{
  23. _new_capacity=a1;
  24. /*[IF*/
  25. if(((C)->_capacity/*8*/)<(_new_capacity)){
  26. /*[IF*/
  27. if(((C)->_capacity/*8*/)==(0)){
  28. C->_storage=calloc(_new_capacity,sizeof(T0*));
  29. }
  30. else{
  31. C->_storage=r363realloc((C)->_storage/*4*/,(C)->_capacity/*8*/,_new_capacity);
  32. }
  33. /*FI]*/
  34. C->_capacity=_new_capacity;
  35. }
  36. /*FI]*/
  37. _new_capacity=(C)->_upper/*12*/;
  38. C->_upper=(a1)-(1);
  39. _i=(C)->_upper/*12*/;
  40. while (!((_i)==(_new_capacity))) {
  41. /*[IRF3.5put*/((C)->_storage/*4*/)[_i]=(_elt_default);
  42. /*]*/
  43. _i=(_i)-(1);
  44. }
  45. }
  46. /*FI]*/
  47. }
  48.  
  49.  
  50. void r362make(T362* C,T2 a1){
  51. /*[IF*/
  52. if((a1)==(0)){
  53. C->_upper=-(1);
  54. }
  55.  else if(((C)->_capacity/*8*/)==(0)){
  56. C->_storage=calloc(a1,sizeof(T0*));
  57. C->_capacity=a1;
  58. C->_upper=(a1)-(1);
  59. }
  60.  else if(((C)->_capacity/*8*/)<(a1)){
  61. C->_storage=calloc(a1,sizeof(T0*));
  62. C->_capacity=a1;
  63. C->_upper=(a1)-(1);
  64. }
  65. else{
  66. C->_upper=(a1)-(1);
  67. /*[IRF3.6clear_all*/{T362* C1=C;
  68. T0* __value=NULL;
  69. /*[IRF3.6set_all_with*/{T362* C2=C1;
  70. T0* c1=__value;
  71. r363set_all_with((C2)->_storage/*4*/,c1,(C2)->_upper/*12*/);
  72. }/*]*/
  73. }/*]*/
  74. }
  75. /*FI]*/
  76. }
  77. /*No:FIXED_ARRAY[TYPE_REF_TO_EXP].upper*/
  78. /*No:FIXED_ARRAY[TYPE_REF_TO_EXP].capacity*/
  79. /*No:FIXED_ARRAY[TYPE_REF_TO_EXP].put*/
  80. /*No:FIXED_ARRAY[TYPE_REF_TO_EXP].storage*/
  81.  
  82.  
  83. void r192with_capacity(T192* C,T2 a1){
  84. /*[IF*/
  85. if(((C)->_capacity/*8*/)<(a1)){
  86. C->_storage=calloc(a1,sizeof(T0*));
  87. C->_capacity=a1;
  88. }
  89. /*FI]*/
  90. C->_upper=-(1);
  91. }
  92.  
  93.  
  94. T0* r192twin(T192* C){
  95. T0* R=NULL;
  96. R=malloc(sizeof(*C));
  97. *((T192*)R)=M192;
  98. r192copy(((T192*)R),((T0*)C));
  99. return R;
  100. }
  101. /*No:FIXED_ARRAY[MANIFEST_STRING].clear_all*/
  102.  
  103.  
  104. void r192add_last(T192* C,T0* a1){
  105. T2 _new_capacity=0;
  106. /*[IF*/
  107. if((((C)->_upper/*12*/)+(1))<=(((C)->_capacity/*8*/)-(1))){
  108. C->_upper=((C)->_upper/*12*/)+(1);
  109. }
  110.  else if(((C)->_capacity/*8*/)==(0)){
  111. C->_storage=calloc(2,sizeof(T0*));
  112. C->_capacity=2;
  113. C->_upper=0;
  114. }
  115. else{
  116. _new_capacity=(2)*((C)->_capacity/*8*/);
  117. C->_storage=r193realloc((C)->_storage/*4*/,(C)->_capacity/*8*/,_new_capacity);
  118. C->_capacity=_new_capacity;
  119. C->_upper=((C)->_upper/*12*/)+(1);
  120. }
  121. /*FI]*/
  122. /*[IRF3.5put*/((C)->_storage/*4*/)[(C)->_upper/*12*/]=(a1);
  123. /*]*/
  124. }
  125. /*No:FIXED_ARRAY[MANIFEST_STRING].item*/
  126. /*No:FIXED_ARRAY[MANIFEST_STRING].set_all_with*/
  127. /*No:FIXED_ARRAY[MANIFEST_STRING].count*/
  128. /*No:FIXED_ARRAY[MANIFEST_STRING].lower*/
  129.  
  130.  
  131. void r192resize(T192* C,T2 a1){
  132. T0* _elt_default=NULL;
  133. T2 _i=0;
  134. T2 _new_capacity=0;
  135. /*[IF*/
  136. if((a1)<=(/*(IRF4.6count*/((C)->_upper/*12*/)+(1)/*)*/)){
  137. C->_upper=(a1)-(1);
  138. }
  139. else{
  140. _new_capacity=a1;
  141. /*[IF*/
  142. if(((C)->_capacity/*8*/)<(_new_capacity)){
  143. /*[IF*/
  144. if(((C)->_capacity/*8*/)==(0)){
  145. C->_storage=calloc(_new_capacity,sizeof(T0*));
  146. }
  147. else{
  148. C->_storage=r193realloc((C)->_storage/*4*/,(C)->_capacity/*8*/,_new_capacity);
  149. }
  150. /*FI]*/
  151. C->_capacity=_new_capacity;
  152. }
  153. /*FI]*/
  154. _new_capacity=(C)->_upper/*12*/;
  155. C->_upper=(a1)-(1);
  156. _i=(C)->_upper/*12*/;
  157. while (!((_i)==(_new_capacity))) {
  158. /*[IRF3.5put*/((C)->_storage/*4*/)[_i]=(_elt_default);
  159. /*]*/
  160. _i=(_i)-(1);
  161. }
  162. }
  163. /*FI]*/
  164. }
  165.  
  166.  
  167. void r192make(T192* C,T2 a1){
  168. /*[IF*/
  169. if((a1)==(0)){
  170. C->_upper=-(1);
  171. }
  172.  else if(((C)->_capacity/*8*/)==(0)){
  173. C->_storage=calloc(a1,sizeof(T0*));
  174. C->_capacity=a1;
  175. C->_upper=(a1)-(1);
  176. }
  177.  else if(((C)->_capacity/*8*/)<(a1)){
  178. C->_storage=calloc(a1,sizeof(T0*));
  179. C->_capacity=a1;
  180. C->_upper=(a1)-(1);
  181. }
  182. else{
  183. C->_upper=(a1)-(1);
  184. /*[IRF3.6clear_all*/{T192* C1=C;
  185. T0* __value=NULL;
  186. /*[IRF3.6set_all_with*/{T192* C2=C1;
  187. T0* c1=__value;
  188. r193set_all_with((C2)->_storage/*4*/,c1,(C2)->_upper/*12*/);
  189. }/*]*/
  190. }/*]*/
  191. }
  192. /*FI]*/
  193. }
  194. /*No:FIXED_ARRAY[MANIFEST_STRING].upper*/
  195.  
  196.  
  197. void r192copy(T192* C,T0* a1){
  198. T2 _new_capacity=0;
  199. T2 _other_upper=0;
  200. _other_upper=(((T192*)a1))->_upper/*12*/;
  201. /*[IF*/
  202. if((_other_upper)>=(0)){
  203. _new_capacity=(_other_upper)+(1);
  204. /*[IF*/
  205. if(((C)->_capacity/*8*/)<(_new_capacity)){
  206. C->_capacity=_new_capacity;
  207. C->_storage=calloc(_new_capacity,sizeof(T0*));
  208. }
  209.  else if(((C)->_capacity/*8*/)>(0)){
  210. r193clear_all((C)->_storage/*4*/,((C)->_capacity/*8*/)-(1));
  211. }
  212. /*FI]*/
  213. r193copy_from((C)->_storage/*4*/,(((T192*)a1))->_storage/*4*/,_other_upper);
  214. }
  215.  else if(((C)->_capacity/*8*/)>(0)){
  216. r193clear_all((C)->_storage/*4*/,((C)->_capacity/*8*/)-(1));
  217. }
  218. /*FI]*/
  219. C->_upper=_other_upper;
  220. }
  221. /*No:FIXED_ARRAY[MANIFEST_STRING].capacity*/
  222. /*No:FIXED_ARRAY[MANIFEST_STRING].put*/
  223. /*No:FIXED_ARRAY[MANIFEST_STRING].storage*/
  224. /*No:ARRAY[BOOLEAN].clear_all*/
  225.  
  226.  
  227. void r348force(T348* C,T6 a1,T2 a2){
  228. /*[IF*/
  229. if(((C)->_upper/*8*/)<(a2)){
  230. r348resize(C,(C)->_lower/*12*/,a2);
  231. }
  232.  else if((a2)<((C)->_lower/*12*/)){
  233. r348resize(C,a2,(C)->_upper/*8*/);
  234. }
  235. /*FI]*/
  236. /*[IRF3.6put*/{T348* C1=C;
  237. T6 b1=a1;
  238. T2 b2=a2;
  239. ((C1)->_storage/*0*/)[(b2)-((C1)->_lower/*12*/)]=(b1);
  240. }/*]*/
  241. }
  242. /*No:ARRAY[BOOLEAN].set_all_with*/
  243.  
  244.  
  245. T6 r348item(T348* C,T2 a1){
  246. T6 R=0;
  247. R=((C)->_storage/*0*/)[(a1)-((C)->_lower/*12*/)];
  248. return R;
  249. }
  250.  
  251.  
  252. T6 r348valid_index(T348* C,T2 a1){
  253. T6 R=0;
  254. R=(((C)->_lower/*12*/)<=(a1))&&((a1)<=((C)->_upper/*8*/));
  255. return R;
  256. }
  257.  
  258.  
  259. void r348set_slice_with(T348* C,T6 a1,T2 a2,T2 a3){
  260. T2 _i=0;
  261. _i=a2;
  262. while (!((_i)>(a3))) {
  263. /*[IRF3.6put*/{T348* C1=C;
  264. T6 b1=a1;
  265. T2 b2=_i;
  266. ((C1)->_storage/*0*/)[(b2)-((C1)->_lower/*12*/)]=(b1);
  267. }/*]*/
  268. _i=(_i)+(1);
  269. }
  270. }
  271. /*No:ARRAY[BOOLEAN].lower*/
  272.  
  273.  
  274. void r348resize(T348* C,T2 a1,T2 a2){
  275. T2 _intersize=0;
  276. T2 _offset=0;
  277. T2 _needed=0;
  278. _needed=((a2)-(a1))+(1);
  279. /*[IF*/
  280. if((_needed)>(0)){
  281. /*[IF*/
  282. if((_needed)>((C)->_capacity/*4*/)){
  283. /*[IF*/
  284. if(((C)->_capacity/*4*/)==(0)){
  285. C->_storage=calloc(_needed,sizeof(T6));
  286. C->_capacity=_needed;
  287. }
  288. else{
  289. C->_storage=r349realloc((C)->_storage/*0*/,(C)->_capacity/*4*/,_needed);
  290. C->_capacity=_needed;
  291. }
  292. /*FI]*/
  293. }
  294. /*FI]*/
  295. _offset=((C)->_lower/*12*/)-(a1);
  296. _intersize=((r2min(a2,(C)->_upper/*8*/))-(r2max(a1,(C)->_lower/*12*/)))+(1);
  297. /*[IF*/
  298. if((_intersize)>(0)){
  299. /*[IF*/
  300. if((_offset)==(0)){
  301. /*[IF*/
  302. if((_intersize)<(_needed)){
  303. r349clear((C)->_storage/*0*/,_intersize,(_needed)-(1));
  304. }
  305. /*FI]*/
  306. }
  307.  else if((_offset)<(0)){
  308. r349move((C)->_storage/*0*/,-(_offset),((_intersize)-(_offset))-(1),_offset);
  309. /*[IF*/
  310. if((_intersize)<(_needed)){
  311. r349clear((C)->_storage/*0*/,_intersize,(_needed)-(1));
  312. }
  313. /*FI]*/
  314. }
  315. else{
  316. r349move((C)->_storage/*0*/,0,(_intersize)-(1),_offset);
  317. r349clear((C)->_storage/*0*/,0,(_offset)-(1));
  318. /*[IF*/
  319. if(((_intersize)+(_offset))<(_needed)){
  320. r349clear((C)->_storage/*0*/,(_intersize)+(_offset),(_needed)-(1));
  321. }
  322. /*FI]*/
  323. }
  324. /*FI]*/
  325. }
  326. else{
  327. r349clear((C)->_storage/*0*/,0,(_needed)-(1));
  328. }
  329. /*FI]*/
  330. }
  331. /*FI]*/
  332. C->_lower=a1;
  333. C->_upper=a2;
  334. }
  335.  
  336.  
  337. void r348make(T348* C,T2 a1,T2 a2){
  338. T2 _needed=0;
  339. C->_lower=a1;
  340. C->_upper=a2;
  341. _needed=((a2)-(a1))+(1);
  342. /*[IF*/
  343. if((_needed)>(0)){
  344. /*[IF*/
  345. if(((C)->_capacity/*4*/)<(_needed)){
  346. C->_storage=calloc(_needed,sizeof(T6));
  347. C->_capacity=_needed;
  348. }
  349. else{
  350. /*[IRF3.6clear_all*/{T348* C1=C;
  351. T6 __value=0;
  352. /*[IRF3.6set_all_with*/{T348* C2=C1;
  353. T6 c1=__value;
  354. r349set_all_with((C2)->_storage/*0*/,c1,((C2)->_upper/*8*/)-((C2)->_lower/*12*/));
  355. }/*]*/
  356. }/*]*/
  357. }
  358. /*FI]*/
  359. }
  360. /*FI]*/
  361. }
  362. /*No:ARRAY[BOOLEAN].upper*/
  363. /*No:ARRAY[BOOLEAN].capacity*/
  364. /*No:ARRAY[BOOLEAN].put*/
  365. /*No:ARRAY[BOOLEAN].storage*/
  366.  
  367.  
  368. void r155add_last(T155* C,T2 a1){
  369. T2 _new_capacity=0;
  370. /*[IF*/
  371. if(((C)->_capacity/*4*/)<((r155count(C))+(1))){
  372. /*[IF*/
  373. if(((C)->_capacity/*4*/)==(0)){
  374. C->_capacity=16;
  375. C->_storage=calloc((C)->_capacity/*4*/,sizeof(T2));
  376. }
  377. else{
  378. _new_capacity=(2)*((C)->_capacity/*4*/);
  379. C->_storage=r46realloc((C)->_storage/*0*/,(C)->_capacity/*4*/,_new_capacity);
  380. C->_capacity=_new_capacity;
  381. }
  382. /*FI]*/
  383. }
  384. /*FI]*/
  385. C->_upper=((C)->_upper/*8*/)+(1);
  386. /*[IRF3.6put*/{T155* C1=C;
  387. T2 b1=a1;
  388. T2 b2=(C)->_upper/*8*/;
  389. ((C1)->_storage/*0*/)[(b2)-((C1)->_lower/*12*/)]=(b1);
  390. }/*]*/
  391. }
  392.  
  393.  
  394. T6 r155valid_index(T155* C,T2 a1){
  395. T6 R=0;
  396. R=(((C)->_lower/*12*/)<=(a1))&&((a1)<=((C)->_upper/*8*/));
  397. return R;
  398. }
  399.  
  400.  
  401. T2 r155count(T155* C){
  402. T2 R=0;
  403. R=(((C)->_upper/*8*/)-((C)->_lower/*12*/))+(1);
  404. return R;
  405. }
  406. /*No:ARRAY[INTEGER].lower*/
  407.  
  408.  
  409. T6 r155fast_has(T155* C,T2 a1){
  410. T6 R=0;
  411. R=r155valid_index(C,r155fast_index_of(C,a1));
  412. return R;
  413. }
  414.  
  415.  
  416. T2 r155fast_index_of(T155* C,T2 a1){
  417. T2 R=0;
  418. R=((C)->_lower/*12*/)+(r46fast_index_of((C)->_storage/*0*/,a1,((C)->_upper/*8*/)-((C)->_lower/*12*/)));
  419. return R;
  420. }
  421. /*No:ARRAY[INTEGER].upper*/
  422. /*No:ARRAY[INTEGER].capacity*/
  423. /*No:ARRAY[INTEGER].put*/
  424. /*No:ARRAY[INTEGER].storage*/
  425.  
  426.  
  427. void r322with_capacity(T322* C,T2 a1){
  428. /*[IF*/
  429. if(((C)->_capacity/*4*/)<(a1)){
  430. C->_storage=calloc(a1,sizeof(T0*));
  431. C->_capacity=a1;
  432. }
  433. /*FI]*/
  434. C->_upper=-(1);
  435. }
  436.  
  437.  
  438. void r322add_last(T322* C,T0* a1){
  439. T2 _new_capacity=0;
  440. /*[IF*/
  441. if((((C)->_upper/*8*/)+(1))<=(((C)->_capacity/*4*/)-(1))){
  442. C->_upper=((C)->_upper/*8*/)+(1);
  443. }
  444.  else if(((C)->_capacity/*4*/)==(0)){
  445. C->_storage=calloc(2,sizeof(T0*));
  446. C->_capacity=2;
  447. C->_upper=0;
  448. }
  449. else{
  450. _new_capacity=(2)*((C)->_capacity/*4*/);
  451. C->_storage=r63realloc((C)->_storage/*0*/,(C)->_capacity/*4*/,_new_capacity);
  452. C->_capacity=_new_capacity;
  453. C->_upper=((C)->_upper/*8*/)+(1);
  454. }
  455. /*FI]*/
  456. /*[IRF3.5put*/((C)->_storage/*0*/)[(C)->_upper/*8*/]=(a1);
  457. /*]*/
  458. }
  459.  
  460.  
  461. void r322remove_last(T322* C){
  462. C->_upper=((C)->_upper/*8*/)-(1);
  463. }
  464. /*No:FIXED_ARRAY[PARENT].item*/
  465.  
  466.  
  467. T0* r322last(T322* C){
  468. T0* R=NULL;
  469. R=/*(IRF4.6item*/((C)->_storage/*0*/)[(C)->_upper/*8*/]/*)*/;
  470. return R;
  471. }
  472. /*No:FIXED_ARRAY[PARENT].count*/
  473. /*No:FIXED_ARRAY[PARENT].upper*/
  474. /*No:FIXED_ARRAY[PARENT].clear*/
  475.  
  476.  
  477. T6 r322empty(T322* C){
  478. T6 R=0;
  479. R=(/*(IRF4.6count*/((C)->_upper/*8*/)+(1)/*)*/)==(0);
  480. return R;
  481. }
  482. /*No:FIXED_ARRAY[PARENT].capacity*/
  483. /*No:FIXED_ARRAY[PARENT].put*/
  484. /*No:FIXED_ARRAY[PARENT].storage*/
  485.  
  486.  
  487. void r23with_capacity(T23* C,T2 a1){
  488. /*[IF*/
  489. if(((C)->_capacity/*4*/)<(a1)){
  490. C->_storage=calloc(a1,sizeof(T0*));
  491. C->_capacity=a1;
  492. }
  493. /*FI]*/
  494. C->_upper=-(1);
  495. }
  496. /*No:FIXED_ARRAY[STRING].clear_all*/
  497.  
  498.  
  499. void r23add_last(T23* C,T0* a1){
  500. T2 _new_capacity=0;
  501. /*[IF*/
  502. if((((C)->_upper/*8*/)+(1))<=(((C)->_capacity/*4*/)-(1))){
  503. C->_upper=((C)->_upper/*8*/)+(1);
  504. }
  505.  else if(((C)->_capacity/*4*/)==(0)){
  506. C->_storage=calloc(2,sizeof(T0*));
  507. C->_capacity=2;
  508. C->_upper=0;
  509. }
  510. else{
  511. _new_capacity=(2)*((C)->_capacity/*4*/);
  512. C->_storage=r24realloc((C)->_storage/*0*/,(C)->_capacity/*4*/,_new_capacity);
  513. C->_capacity=_new_capacity;
  514. C->_upper=((C)->_upper/*8*/)+(1);
  515. }
  516. /*FI]*/
  517. /*[IRF3.5put*/((C)->_storage/*0*/)[(C)->_upper/*8*/]=(a1);
  518. /*]*/
  519. }
  520. /*No:FIXED_ARRAY[STRING].item*/
  521. /*No:FIXED_ARRAY[STRING].set_all_with*/
  522. /*No:FIXED_ARRAY[STRING].count*/
  523.  
  524.  
  525. void r23resize(T23* C,T2 a1){
  526. T0* _elt_default=NULL;
  527. T2 _i=0;
  528. T2 _new_capacity=0;
  529. /*[IF*/
  530. if((a1)<=(/*(IRF4.6count*/((C)->_upper/*8*/)+(1)/*)*/)){
  531. C->_upper=(a1)-(1);
  532. }
  533. else{
  534. _new_capacity=a1;
  535. /*[IF*/
  536. if(((C)->_capacity/*4*/)<(_new_capacity)){
  537. /*[IF*/
  538. if(((C)->_capacity/*4*/)==(0)){
  539. C->_storage=calloc(_new_capacity,sizeof(T0*));
  540. }
  541. else{
  542. C->_storage=r24realloc((C)->_storage/*0*/,(C)->_capacity/*4*/,_new_capacity);
  543. }
  544. /*FI]*/
  545. C->_capacity=_new_capacity;
  546. }
  547. /*FI]*/
  548. _new_capacity=(C)->_upper/*8*/;
  549. C->_upper=(a1)-(1);
  550. _i=(C)->_upper/*8*/;
  551. while (!((_i)==(_new_capacity))) {
  552. /*[IRF3.5put*/((C)->_storage/*0*/)[_i]=(_elt_default);
  553. /*]*/
  554. _i=(_i)-(1);
  555. }
  556. }
  557. /*FI]*/
  558. }
  559.  
  560.  
  561. void r23make(T23* C,T2 a1){
  562. /*[IF*/
  563. if((a1)==(0)){
  564. C->_upper=-(1);
  565. }
  566.  else if(((C)->_capacity/*4*/)==(0)){
  567. C->_storage=calloc(a1,sizeof(T0*));
  568. C->_capacity=a1;
  569. C->_upper=(a1)-(1);
  570. }
  571.  else if(((C)->_capacity/*4*/)<(a1)){
  572. C->_storage=calloc(a1,sizeof(T0*));
  573. C->_capacity=a1;
  574. C->_upper=(a1)-(1);
  575. }
  576. else{
  577. C->_upper=(a1)-(1);
  578. /*[IRF3.6clear_all*/{T23* C1=C;
  579. T0* __value=NULL;
  580. /*[IRF3.6set_all_with*/{T23* C2=C1;
  581. T0* c1=__value;
  582. r24set_all_with((C2)->_storage/*0*/,c1,(C2)->_upper/*8*/);
  583. }/*]*/
  584. }/*]*/
  585. }
  586. /*FI]*/
  587. }
  588.  
  589.  
  590. T2 r23fast_index_of(T23* C,T0* a1){
  591. T2 R=0;
  592. R=r24fast_index_of((C)->_storage/*0*/,a1,(C)->_upper/*8*/);
  593. return R;
  594. }
  595. /*No:FIXED_ARRAY[STRING].upper*/
  596. /*No:FIXED_ARRAY[STRING].capacity*/
  597. /*No:FIXED_ARRAY[STRING].put*/
  598. /*No:FIXED_ARRAY[STRING].storage*/
  599.  
  600.  
  601. void r32with_capacity(T32* C,T2 a1,T2 a2){
  602. /*[IF*/
  603. if(((C)->_capacity/*4*/)<(a1)){
  604. C->_storage=calloc(a1,sizeof(T0*));
  605. C->_capacity=a1;
  606. }
  607. /*FI]*/
  608. C->_lower=a2;
  609. C->_upper=(a2)-(1);
  610. }
  611. /*No:ARRAY[STRING].clear_all*/
  612.  
  613.  
  614. void r32add_last(T32* C,T0* a1){
  615. T2 _new_capacity=0;
  616. /*[IF*/
  617. if(((C)->_capacity/*4*/)<((r32count(C))+(1))){
  618. /*[IF*/
  619. if(((C)->_capacity/*4*/)==(0)){
  620. C->_capacity=16;
  621. C->_storage=calloc((C)->_capacity/*4*/,sizeof(T0*));
  622. }
  623. else{
  624. _new_capacity=(2)*((C)->_capacity/*4*/);
  625. C->_storage=r24realloc((C)->_storage/*0*/,(C)->_capacity/*4*/,_new_capacity);
  626. C->_capacity=_new_capacity;
  627. }
  628. /*FI]*/
  629. }
  630. /*FI]*/
  631. C->_upper=((C)->_upper/*8*/)+(1);
  632. /*[IRF3.6put*/{T32* C1=C;
  633. T0* b1=a1;
  634. T2 b2=(C)->_upper/*8*/;
  635. ((C1)->_storage/*0*/)[(b2)-((C1)->_lower/*12*/)]=(b1);
  636. }/*]*/
  637. }
  638. /*No:ARRAY[STRING].set_all_with*/
  639.  
  640.  
  641. T0* r32item(T32* C,T2 a1){
  642. T0* R=NULL;
  643. R=((C)->_storage/*0*/)[(a1)-((C)->_lower/*12*/)];
  644. return R;
  645. }
  646.  
  647.  
  648. T6 r32valid_index(T32* C,T2 a1){
  649. T6 R=0;
  650. R=(((C)->_lower/*12*/)<=(a1))&&((a1)<=((C)->_upper/*8*/));
  651. return R;
  652. }
  653.  
  654.  
  655. T0* r32first(T32* C){
  656. T0* R=NULL;
  657. R=r32item(C,(C)->_lower/*12*/);
  658. return R;
  659. }
  660.  
  661.  
  662. T2 r32count(T32* C){
  663. T2 R=0;
  664. R=(((C)->_upper/*8*/)-((C)->_lower/*12*/))+(1);
  665. return R;
  666. }
  667. /*No:ARRAY[STRING].lower*/
  668.  
  669.  
  670. void r32make(T32* C,T2 a1,T2 a2){
  671. T2 _needed=0;
  672. C->_lower=a1;
  673. C->_upper=a2;
  674. _needed=((a2)-(a1))+(1);
  675. /*[IF*/
  676. if((_needed)>(0)){
  677. /*[IF*/
  678. if(((C)->_capacity/*4*/)<(_needed)){
  679. C->_storage=calloc(_needed,sizeof(T0*));
  680. C->_capacity=_needed;
  681. }
  682. else{
  683. /*[IRF3.6clear_all*/{T32* C1=C;
  684. T0* __value=NULL;
  685. /*[IRF3.6set_all_with*/{T32* C2=C1;
  686. T0* c1=__value;
  687. r24set_all_with((C2)->_storage/*0*/,c1,((C2)->_upper/*8*/)-((C2)->_lower/*12*/));
  688. }/*]*/
  689. }/*]*/
  690. }
  691. /*FI]*/
  692. }
  693. /*FI]*/
  694. }
  695.  
  696.  
  697. T6 r32fast_has(T32* C,T0* a1){
  698. T6 R=0;
  699. R=r32valid_index(C,r32fast_index_of(C,a1));
  700. return R;
  701. }
  702.  
  703.  
  704. T2 r32fast_index_of(T32* C,T0* a1){
  705. T2 R=0;
  706. R=((C)->_lower/*12*/)+(r24fast_index_of((C)->_storage/*0*/,a1,((C)->_upper/*8*/)-((C)->_lower/*12*/)));
  707. return R;
  708. }
  709. /*No:ARRAY[STRING].upper*/
  710.  
  711.  
  712. void r32clear(T32* C){
  713. C->_upper=((C)->_lower/*12*/)-(1);
  714. }
  715.  
  716.  
  717. T6 r32empty(T32* C){
  718. T6 R=0;
  719. R=(r32count(C))==(0);
  720. return R;
  721. }
  722.  
  723.  
  724. T2 r32index_of(T32* C,T0* a1){
  725. T2 R=0;
  726. R=((C)->_lower/*12*/)+(r24index_of((C)->_storage/*0*/,a1,((C)->_upper/*8*/)-((C)->_lower/*12*/)));
  727. return R;
  728. }
  729. /*No:ARRAY[STRING].capacity*/
  730. /*No:ARRAY[STRING].put*/
  731. /*No:ARRAY[STRING].storage*/
  732.  
  733.  
  734. void r61add_last(T61* C,T0* a1){
  735. T2 _new_capacity=0;
  736. /*[IF*/
  737. if(((C)->_capacity/*4*/)<((r61count(C))+(1))){
  738. /*[IF*/
  739. if(((C)->_capacity/*4*/)==(0)){
  740. C->_capacity=16;
  741. C->_storage=calloc((C)->_capacity/*4*/,sizeof(T0*));
  742. }
  743. else{
  744. _new_capacity=(2)*((C)->_capacity/*4*/);
  745. C->_storage=r63realloc((C)->_storage/*0*/,(C)->_capacity/*4*/,_new_capacity);
  746. C->_capacity=_new_capacity;
  747. }
  748. /*FI]*/
  749. }
  750. /*FI]*/
  751. C->_upper=((C)->_upper/*8*/)+(1);
  752. /*[IRF3.6put*/{T61* C1=C;
  753. T0* b1=a1;
  754. T2 b2=(C)->_upper/*8*/;
  755. ((C1)->_storage/*0*/)[(b2)-((C1)->_lower/*12*/)]=(b1);
  756. }/*]*/
  757. }
  758.  
  759.  
  760. T0* r61item(T61* C,T2 a1){
  761. T0* R=NULL;
  762. R=((C)->_storage/*0*/)[(a1)-((C)->_lower/*12*/)];
  763. return R;
  764. }
  765.  
  766.  
  767. T0* r61first(T61* C){
  768. T0* R=NULL;
  769. R=r61item(C,(C)->_lower/*12*/);
  770. return R;
  771. }
  772.  
  773.  
  774. T2 r61count(T61* C){
  775. T2 R=0;
  776. R=(((C)->_upper/*8*/)-((C)->_lower/*12*/))+(1);
  777. return R;
  778. }
  779. /*No:ARRAY[PARENT].lower*/
  780. /*No:ARRAY[PARENT].upper*/
  781. /*No:ARRAY[PARENT].capacity*/
  782. /*No:ARRAY[PARENT].put*/
  783. /*No:ARRAY[PARENT].storage*/
  784.  
  785.  
  786. T0* r219twin(T219* C){
  787. T0* R=NULL;
  788. R=malloc(sizeof(*C));
  789. *((T219*)R)=M219;
  790. r219copy(((T219*)R),((T0*)C));
  791. return R;
  792. }
  793.  
  794.  
  795. void r219add_last(T219* C,T0* a1){
  796. T2 _new_capacity=0;
  797. /*[IF*/
  798. if(((C)->_capacity/*4*/)<((r219count(C))+(1))){
  799. /*[IF*/
  800. if(((C)->_capacity/*4*/)==(0)){
  801. C->_capacity=16;
  802. C->_storage=calloc((C)->_capacity/*4*/,sizeof(T0*));
  803. }
  804. else{
  805. _new_capacity=(2)*((C)->_capacity/*4*/);
  806. C->_storage=r220realloc((C)->_storage/*0*/,(C)->_capacity/*4*/,_new_capacity);
  807. C->_capacity=_new_capacity;
  808. }
  809. /*FI]*/
  810. }
  811. /*FI]*/
  812. C->_upper=((C)->_upper/*8*/)+(1);
  813. /*[IRF3.6put*/{T219* C1=C;
  814. T0* b1=a1;
  815. T2 b2=(C)->_upper/*8*/;
  816. ((C1)->_storage/*0*/)[(b2)-((C1)->_lower/*12*/)]=(b1);
  817. }/*]*/
  818. }
  819.  
  820.  
  821. T0* r219item(T219* C,T2 a1){
  822. T0* R=NULL;
  823. R=((C)->_storage/*0*/)[(a1)-((C)->_lower/*12*/)];
  824. return R;
  825. }
  826.  
  827.  
  828. T2 r219count(T219* C){
  829. T2 R=0;
  830. R=(((C)->_upper/*8*/)-((C)->_lower/*12*/))+(1);
  831. return R;
  832. }
  833. /*No:ARRAY[E_WHEN].lower*/
  834. /*No:ARRAY[E_WHEN].upper*/
  835.  
  836.  
  837. void r219copy(T219* C,T0* a1){
  838. T2 _needed_capacity=0;
  839. C->_lower=(((T219*)a1))->_lower/*12*/;
  840. C->_upper=(((T219*)a1))->_upper/*8*/;
  841. _needed_capacity=(((C)->_upper/*8*/)-((C)->_lower/*12*/))+(1);
  842. /*[IF*/
  843. if(((C)->_capacity/*4*/)<(_needed_capacity)){
  844. C->_capacity=_needed_capacity;
  845. C->_storage=calloc((C)->_capacity/*4*/,sizeof(T0*));
  846. }
  847. /*FI]*/
  848. /*[IF*/
  849. if((_needed_capacity)>(0)){
  850. r220copy_from((C)->_storage/*0*/,(((T219*)a1))->_storage/*0*/,(_needed_capacity)-(1));
  851. }
  852. /*FI]*/
  853. }
  854. /*No:ARRAY[E_WHEN].capacity*/
  855. /*No:ARRAY[E_WHEN].put*/
  856. /*No:ARRAY[E_WHEN].storage*/
  857.  
  858.  
  859. T0* r212twin(T212* C){
  860. T0* R=NULL;
  861. R=malloc(sizeof(*C));
  862. *((T212*)R)=M212;
  863. r212copy(((T212*)R),((T0*)C));
  864. return R;
  865. }
  866.  
  867.  
  868. void r212add_last(T212* C,T0* a1){
  869. T2 _new_capacity=0;
  870. /*[IF*/
  871. if(((C)->_capacity/*4*/)<((r212count(C))+(1))){
  872. /*[IF*/
  873. if(((C)->_capacity/*4*/)==(0)){
  874. C->_capacity=16;
  875. C->_storage=calloc((C)->_capacity/*4*/,sizeof(T0*));
  876. }
  877. else{
  878. _new_capacity=(2)*((C)->_capacity/*4*/);
  879. C->_storage=r213realloc((C)->_storage/*0*/,(C)->_capacity/*4*/,_new_capacity);
  880. C->_capacity=_new_capacity;
  881. }
  882. /*FI]*/
  883. }
  884. /*FI]*/
  885. C->_upper=((C)->_upper/*8*/)+(1);
  886. /*[IRF3.6put*/{T212* C1=C;
  887. T0* b1=a1;
  888. T2 b2=(C)->_upper/*8*/;
  889. ((C1)->_storage/*0*/)[(b2)-((C1)->_lower/*12*/)]=(b1);
  890. }/*]*/
  891. }
  892.  
  893.  
  894. T0* r212item(T212* C,T2 a1){
  895. T0* R=NULL;
  896. R=((C)->_storage/*0*/)[(a1)-((C)->_lower/*12*/)];
  897. return R;
  898. }
  899.  
  900.  
  901. T2 r212count(T212* C){
  902. T2 R=0;
  903. R=(((C)->_upper/*8*/)-((C)->_lower/*12*/))+(1);
  904. return R;
  905. }
  906. /*No:ARRAY[IFTHEN].lower*/
  907. /*No:ARRAY[IFTHEN].upper*/
  908.  
  909.  
  910. void r212copy(T212* C,T0* a1){
  911. T2 _needed_capacity=0;
  912. C->_lower=(((T212*)a1))->_lower/*12*/;
  913. C->_upper=(((T212*)a1))->_upper/*8*/;
  914. _needed_capacity=(((C)->_upper/*8*/)-((C)->_lower/*12*/))+(1);
  915. /*[IF*/
  916. if(((C)->_capacity/*4*/)<(_needed_capacity)){
  917. C->_capacity=_needed_capacity;
  918. C->_storage=calloc((C)->_capacity/*4*/,sizeof(T0*));
  919. }
  920. /*FI]*/
  921. /*[IF*/
  922. if((_needed_capacity)>(0)){
  923. r213copy_from((C)->_storage/*0*/,(((T212*)a1))->_storage/*0*/,(_needed_capacity)-(1));
  924. }
  925. /*FI]*/
  926. }
  927. /*No:ARRAY[IFTHEN].capacity*/
  928. /*No:ARRAY[IFTHEN].put*/
  929. /*No:ARRAY[IFTHEN].storage*/
  930.  
  931.